package com.vchello.controller.admin;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.vchello.bean.user.User;
import com.vchello.controller.BaseController;
import com.vchello.service.user.UserService;
import com.vchello.util.ExportUtil;

/**
 * 
 * @author power
 *
 */
@Controller
@RequestMapping(value = "/admin/export")
public class ExportController extends BaseController {
	
	@Autowired
	private UserService userService;

	@RequestMapping(value = "/user", method = RequestMethod.GET)
	public void user(User user){
		List<User> list = userService.queryList(user);
		String[] headers = new String[]{"用户名", "用户类型", "邮箱", "手机", "创建时间", "最后登录时间"};
		ExportUtil.exportExcel(response, "用户", "用户信息.xls", headers, list);
	}

}
